package com.hnevc.ormlitedemo;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;

import com.hnevc.ormlitedemo.entity.RechargeRecord;
import com.hnevc.ormlitedemo.utlis.RechargeRecordDao;

import java.util.Date;
import java.util.List;

public class MainActivity extends AppCompatActivity {
    private static final String TAG = "MainActivity";
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        RechargeRecord record = new RechargeRecord();
        record.setRechargeamount(100);
        record.setRechargebalance(120);
        record.setRechargecarnumber("鲁B10001");
        record.setRechargedate(new Date(System.currentTimeMillis()));
        record.setRecharger("张三");

        RechargeRecordDao dao = new RechargeRecordDao(this);
        int result = dao.addRechargeRecord(record);
        List<RechargeRecord> rechargeRecords = dao.queryForAll();

    }
}
